
<!DOCTYPE html>
<html>

<!-- Head -->
<head>

	<title>登录表单</title>

	<!-- Meta-Tags -->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
	<!-- //Meta-Tags -->

	<!-- Style --> <link rel="stylesheet" href="css/style.css" type="text/css" media="all">



</head>
<!-- //Head -->

<!-- Body -->
<body>


<script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
	<h1>JK-PAY</h1>


	<div class="container w3layouts agileits">

		<div class="login w3layouts agileits">
			<h2>登 录</h2>
			<form  method="post" id="loginForm">
				<span id="numberFlag"><font color='red'></font></span>
				<input type="text" Name="userNumber" id="userNumber" placeholder="用户名" onblur="cleSpan()" required="">
				<span id="passFlag"></span>
				<input type="password" Name="userPwd" id="userPwd" placeholder="密码"   onblur="cleSpan()" required="">
			</form>
			<ul class="tick w3layouts agileits">
				<li>
					<input type="checkbox" id="brand1" value="">
					<label for="brand1"><span></span>忘记我</label>
				</li>
			</ul>
			<div class="send-button w3layouts agileits">
				<form>
					<input type="button"  value="登 录" onclick="login()" id="loginButton">
				</form>
			</div>

			<script>


				function ale() {
                }

                function cleSpan(){
                    $("#numberFlag").html("<font color='red'></font>")
                    $("#passFlag").html("<font color='red'></font>")
				}
                var shopping = document.getElementById("loginButton");
                    function login(){

                        shopping.setAttribute("value","登录中。。。");
                    if($("#userNumber").val()==null||$("#userNumber").val()==""){
                        $("#numberFlag").html("<font color='red'>*账号不能为空</font>")
                        $("#passFlag").html("<font color='red'></font>")
                        shopping.setAttribute("value","登录");
                    }else if($("#userPwd").val()==null||$("#userPwd").val()==""){
                        $("#numberFlag").html("<font color='red'></font>")
                        $("#passFlag").html("<font color='red'>*密码不能为空</font>")
                        shopping.setAttribute("value","登录");
                    }else{
                        $.ajax({
                            url:"http://127.0.0.1:8061/LogAndReg/userLog.do",
                            type : "post",
                            data : $("#loginForm").serialize(),
                            dataType : "json",
                            success : function(aa) {
                                if (aa.e== 4) {    //登陆成功
                                    ifDetails(aa);
                                } else if (aa.e == 2) {   //密码错误
                                    $("#numberFlag").html("<font color='red'></font>")
                                    $("#passFlag").html("<font color='red'>密码错误！</font>")
                                    shopping.setAttribute("value","登录");
                                }else if(aa.e == 3){            //登陆成功，登陆Ip为陌生Ip,需进行安全验证
									alert(1);
                                    ifDetails(aa);
								}
                                else if (aa.e == 1) {
                                    $("#numberFlag").html(
                                        "<font color='red'>用户不存在！</font>")
                                    $("#passFlag").html("<font color='red'></font>")
                                    shopping.setAttribute("value","登录");
                                }
                            },
                            error : function() {
                                alert("系统错误，请联系管理员！！！");
                                shopping.setAttribute("value","登录");
                            }
                        })
                    }
                }
                function ifDetails(aa){
                    if(aa.t=1){    //个人用户
                        window.open("/money.html");
                    }else if(aa.t==2){   //企业用户
                        if(aa.s==1){     //状态正常
                            window.open("/showEnterprise.html");
                        }else if(aa.s==2){  // 为未填写实名状态
                            window.open("/showEnterprise.html");
                        }else if(aa.s==3){    //实名信息正在审核
                            window.open("/showEnterprise.html");
                        }else if(aa.s==4){     //实名信息审核未通过
                            window.open("/showEnterprise.html");
                        }
                    }
                    shopping.setAttribute("value","登录");
				}
                function  toRegView(){
                    location.href="/regUI/jQuery-verify20160304/index.html";
                }

			</script>

			<a href="#">记住密码?</a>
			<div class="social-icons w3layouts agileits">
				<p>- 其他方式登录 -</p>
				<ul>
					<li class="qq"><a href="#">
					<span class="icons w3layouts agileits"></span>
					<span class="text w3layouts agileits">QQ</span></a></li>
					<li class="weixin w3ls"><a href="#">
					<span class="icons w3layouts"></span>
					<span class="text w3layouts agileits">微信</span></a></li>
					<li class="weibo aits"><a href="#">
					<span class="icons agileits"></span>
					<span class="text w3layouts agileits">微博</span></a></li>
					<div class="clear"> </div>
				</ul>
			</div>
			<div class="clear"></div>
		</div><div class="copyrights">Collect from <a href="http://www.cssmoban.com/" >企业网站模板</a></div>
		<div class="register w3layouts agileits">
			<h2>注 册</h2>
			<form action="#" method="post">
				<input type="text" Name="Name" placeholder="用户名" required="">
				<input type="text" Name="Email" placeholder="邮箱" required="">
				<input type="password" Name="Password" placeholder="密码" required="">
				<input type="text" Name="Phone Number" placeholder="手机号码" required="">
			</form>
			<div class="send-button w3layouts agileits">
				<form>
					<input type="button" value="免费注册" onclick="toRegView()">
				</form>
			</div>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>

	</div>

	<div class="footer w3layouts agileits">
		<p>Copyright &copy; More Sys <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">不挨门口小组</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">jk-pay</a></p>
	</div>

</body>
<!-- //Body -->

</html>